package com.it.schoolbookshop_back.enums;

public enum UserStatusEnums {
    ACTIVE(0),
    SUSPENDED(1),
    DELETED(2);

    private final int code;

    UserStatusEnums(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static UserStatusEnums getByCode(int code) {
        for (UserStatusEnums status : UserStatusEnums.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        return null;
    }
}
